home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SCREEN.SWG / 0008_SAVERES.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  1KB  |  51 lines

  1. Uses Dos,Crt;
  2. { saves and restores and area of screen }
  3. Const
  4.    Max = 3;
  5.  
  6. Type
  7.    ScreenImage = Array[0..1999] of word;
  8.    FrameRec    = Record
  9.                     Upperleft    : Word;
  10.                     LowerRight   : Word;
  11.                     ScreenMemory : ScreenImage;
  12.                  End;
  13.  
  14. VAR
  15.    SnapShot     : ^ScreenImage;
  16.    FrameStore   : Array [1..10] of ^FrameRec;
  17.    WindowNum    : Byte;
  18.  
  19. Procedure OpenWindow(UpLeftX,UpLeftY,LoRightX,LoRightY : Byte);
  20. Begin
  21.    SnapShot := Ptr( $B800, $0000);
  22.    Inc(WindowNum);
  23.    New(FrameStore[WindowNum]);
  24.    WITH Framestore[WindowNum]^ do
  25.    Begin
  26.       ScreenMemory := SnapShot^;
  27.       UpperLeft    := WindMin;
  28.       LowerRight   := WindMax;
  29.    end;
  30.    Window(UpLeftX,UpLeftY,LoRightX,LoRightY);
  31. end;
  32.  
  33. Procedure CloseWindow;
  34. Begin
  35.    With Framestore[WindowNum]^ do
  36.    Begin
  37.       Snapshot^ := ScreenMemory;
  38.       Window ( (Lo(UpperLeft)+1), (Hi(UpperLeft)+1),
  39.              (Lo(LowerRight)+1), (Hi(LowerRight)+1) );
  40.    end;
  41.    Dispose( Framestore[WindowNum]);
  42.    Dec(WindowNum);
  43. End;
  44.  
  45. Begin
  46. OpenWIndow(3,3,45,15);
  47. ClrScr;
  48. Readkey;
  49. CloseWindow;
  50. End.
  51.